﻿<%@ Page Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="SearchAssignments.aspx.cs" Inherits="TempEmployees.Web.WebForm6"
    Title="מעקב אחר העסקות" %>

<%@ Register Src="UserControls/GridViews/GridViewAssignments.ascx" TagName="GridViewAssignments"
    TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="./Scripts/SelecetRadioButton.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <%
        if (State.UserRole == TempEmployees.BLL.DbConstants.Roles.HeadDepartment) Response.Write(
            "<input type=\"checkbox\" id=\"refresh\" onclick=\"SetTimer()\" checked/>ריענון אוטומטי " +
            "<script type=\"text/javascript\"> " + 
            "var reloadTimerId = 0; " +
            "SetTimer(); " +
            "function SetTimer() { " + 
            "if (document.getElementsByTagName(\"input\").namedItem(\"refresh\").checked == true) reloadTimerId = setTimeout(\"window.location.reload()\", 600000); " +
            "else clearTimeout(reloadTimerId); " +
            "} " +
            "</script>");
    %>
    <table class="searchAssignments-table" dir="rtl">
        <tr>
            <td>
                <div class="searchAssignments-messageDiv">
                    <asp:Panel ID="PanelUpdateMessage" runat="server" Visible="false">
                        <asp:Label ID="LabelUpdateMessage" runat="server" Text=""></asp:Label>
                        <br />
                        <asp:Label ID="LabelAssignmentId" runat="server" Text=""></asp:Label>
                    </asp:Panel>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input id="RadioByID" type="radio" runat="server" />
                <asp:Label ID="Label2" runat="server" Text="חיפוש לפי מספר העסקה"></asp:Label>
                <asp:TextBox ID="TextBoxSearchId" runat="server"></asp:TextBox>
                <br />
            </td>
        </tr>
        <tr>
            <td>
                <input id="RadioByFilters" type="radio" runat="server" />
                <asp:Label ID="Label5" runat="server" Text="חיפוש כללי:"></asp:Label>
                <br />
                <asp:Label ID="Label1" runat="server" Text="&#1505;&#1496;&#1496;&#1493;&#1505; &#1489;&#1511;&#1513;&#1492;: "></asp:Label>
                <asp:DropDownList ID="DropDownListStatus" runat="server">
                </asp:DropDownList>
                <asp:Label ID="LabelEmployer" runat="server" Text="&#1502;&#1506;&#1505;&#1497;&#1511;: "></asp:Label>
                <asp:DropDownList ID="DropDownListUsers" runat="server">
                </asp:DropDownList>
                <asp:Label ID="Label3" runat="server" Text="&#1514;&#1511;&#1510;&#1497;&#1489;: "></asp:Label>
                <asp:DropDownList ID="DropDownListBudgetTypes" runat="server">
                </asp:DropDownList>
                <br />
                <br />
                <asp:Button ID="ButtonSearch" runat="server" OnClick="ButtonSearch_Click" Text="&#1495;&#1508;&#1513;" />
                <asp:Button ID="ExportToExcel" runat="server" OnClick="ExportToExcel_Click" Text="הפקת דוח" />
                <br />
                <asp:UpdatePanel ID="UpdatePanelAssignments" runat="server">
                    <ContentTemplate>
                        <fieldset>
                            <legend class="legend">&#1489;&#1511;&#1513;&#1493;&#1514; &#1492;&#1506;&#1505;&#1511;&#1492;
                            </legend>
                            <uc1:GridViewAssignments ID="GridViewAssignments1" runat="server" />
                        </fieldset>
                    </ContentTemplate>
                    <Triggers>
                        <asp:PostBackTrigger ControlID="GridViewAssignments1" />
                        <asp:AsyncPostBackTrigger ControlID="ButtonSearch" />
                    </Triggers>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
    <asp:UpdatePanel ID="ProduceFormPanel" runat="server">
        <ContentTemplate>
            <asp:Label ID="ProcudeFormID" runat="server" Text="" Visible="false"></asp:Label>
            <asp:Timer ID="ProduceFormTimer" runat="server" Interval="100" Enabled="false" OnTick="ProduceForm_Tick">
            </asp:Timer>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="ProduceFormTimer" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
